package com.yunxin.admin.system.application.impl;

import com.yunxin.admin.system.application.LogApplicationService;
import com.yunxin.admin.system.application.assembler.LogAssembler;
import com.yunxin.admin.system.application.command.LogCommand;
import com.yunxin.admin.system.domain.model.log.Log;
import com.yunxin.admin.system.domain.model.log.LogRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author zero°
 * @since 2023-07-11
 */
@Service
@RequiredArgsConstructor
public class LogApplicationServiceImpl implements LogApplicationService {

    private final LogRepository logRepository;

    private final LogAssembler logAssembler;

    @Override
    public boolean saveLog(LogCommand command) {
        Log log = logAssembler.formLogCommand(command);
        return logRepository.saveLog(log);
    }
}
